package Z06XianCheng.XC01StartXianCheng;

public class StartXainCheng {}

class TestThread {
    public static void main(String[] args) {


        Hero gareen = new Hero();
        gareen.name = "盖伦";
        gareen.hp = 616;
        gareen.damage = 50;

        Hero teemo = new Hero();
        teemo.name = "提莫";
        teemo.hp = 300;
        teemo.damage = 30;

        Hero bh = new Hero();
        bh.name = "赏金猎人";
        bh.hp = 500;
        bh.damage = 65;

        Hero leesin = new Hero();
        leesin.name = "盲僧";
        leesin.hp = 455;
        leesin.damage = 80;

//        while (!teemo.isDead()){
//            gareen.AttackHero(teemo);
//        }
//
//        while (!leesin.isDead()){
//            bh.AttackHero(leesin);
//        }

//        KillThead killThead1 = new KillThead(gareen,teemo);
//        killThead1.start();
//        KillThead killThead2 = new KillThead(bh,leesin);
//        killThead2.start();


//        battle battle1 = new battle(gareen ,teemo);
//        new Thread(battle1).start();
//        battle battle2 = new battle(gareen ,teemo);
//        new Thread(battle2).start();

        Thread t1 = new Thread(){
            @Override
            public void run() {
                while (!teemo.isDead()){
                    gareen.AttackHero(teemo);
                }
            }
        };
        t1.start();

        Thread t2 = new Thread(){
            @Override
            public void run() {
                while (!leesin.isDead()){
                    bh.AttackHero(leesin);
                }
            }
        };
        t2.start();

    }
}

